package com.example.demo.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.Order;
import com.example.demo.entity.Order2;
import com.example.demo.entity.Commdity;
import com.example.demo.entity.Shop;
import com.example.demo.entity.User;
import com.example.demo.mapper.CommdityMapper;
import com.example.demo.mapper.OrderMapper;
import com.example.demo.mapper.UserMapper;
import com.example.demo.service.OrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService{

    @Resource
    public OrderMapper OrderMapper;
    public List<Order> getList() {
        return OrderMapper.findAll();
    }
    public List<Order> getstateList(int state) {
        return OrderMapper.findBy_state(state);
    }
    public List<Order> getidList(int id) {
        return OrderMapper.findBy_id(id);
    }

    //取消
    public Boolean getmodify(int orderid) {
        return OrderMapper.modify(orderid);
    }
    //支付
    public Boolean getmodify1(int orderid) {
        return OrderMapper.modify_state1(orderid);
    }
    //发货
    public Boolean getmodify3(int orderid) {
        return OrderMapper.modify_state3(orderid);
    }
    //收货
    public Boolean getmodify4(int orderid) {
        return OrderMapper.modify_state4(orderid);
    }
    //申请退单
    public Boolean getmodify2(int orderid) {
        return OrderMapper.modify_state2(orderid);
    }
    //同意退单
    public Boolean getmodify5(int orderid) {
        return OrderMapper.modify_state5(orderid);
    }

}
